#include "guiterm.hpp"

FileAction::FileAction(string description, string effect, Session *handler, bool requiresConfirmation, QObject *parent)
	:QAction(description.c_str(), parent)
{
	this->description = description;
	this->effect = effect;
	this->handler = handler;
	this->requiresConfirmation = requiresConfirmation;
	
	connect(this, SIGNAL(triggered()), this , SLOT(doCommand()));
}

void FileAction::doCommand()
{
	if(requiresConfirmation)
		handler->unconfirmedCommand(effect);
	else
		handler->mousedCommand(effect);
}

